<template>
    <div class="back_button">
      <!--返回按钮-->
      <el-button type="primary" class="green-btn" size="small" @click="goBack">返回</el-button>
    </div>
</template>

<script>
    export default {
      name: "backButton",
      methods: {
        goBack() {
          if (this.$attrs.path) {
            this.$router.push(this.$attrs.path)
          } else {
            this.$router.go(-1)
          }
        }
      }
    }
</script>

<style lang='scss' scoped>
  .back_button {
    width: 100%;
    text-align: right;
  }
</style>
